```html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>TransmittableThreadLocal - 解决异步线程数据传递难题</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css">
    <link rel="stylesheet" href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            color: #333;
            line-height: 1.6;
        }
        h1, h2, h3, h4 {
            font-family: 'Noto Serif SC', serif;
            font-weight: 600;
            color: #1a1a1a;
        }
        .hero {
            background: linear-gradient(135deg, #6e8efb 0%, #a777e3 100%);
            color: white;
        }
        .card {
            transition: all 0.3s ease;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        }
        .card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
        }
        .highlight {
            background: linear-gradient(90deg, rgba(110,142,251,0.1) 0%, rgba(167,119,227,0.1) 100%);
            border-left: 4px solid #6e8efb;
        }
        .dropdown:hover .dropdown-content {
            display: block;
        }
        .footer {
            background-color: #1a1a1a;
        }
    </style>
</head>
<body class="bg-gray-50">
    <!-- Navigation -->
    <nav class="bg-white shadow-sm sticky top-0 z-50">
        <div class="max-w-6xl mx-auto px-4 sm:px-6 lg:px-8">
            <div class="flex justify-between h-16">
                <div class="flex items-center">
                    <div class="flex-shrink-0 flex items-center">
                        <i class="fas fa-code text-indigo-600 text-xl mr-2"></i>
                        <span class="text-xl font-semibold text-gray-800">Java技术专栏</span>
                    </div>
                </div>
                <div class="hidden sm:ml-6 sm:flex sm:items-center">
                    <div class="ml-10 flex items-baseline space-x-4">
                        <a href="#" class="px-3 py-2 rounded-md text-sm font-medium text-gray-700 hover:text-indigo-600 hover:bg-gray-100">首页</a>
                        <div class="dropdown relative">
                            <button class="px-3 py-2 rounded-md text-sm font-medium text-gray-700 hover:text-indigo-600 hover:bg-gray-100 flex items-center">
                                多线程 <i class="fas fa-chevron-down ml-1 text-xs"></i>
                            </button>
                            <div class="dropdown-content hidden absolute right-0 mt-2 w-56 rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5">
                                <div class="py-1">
                                    <a href="#" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">ThreadLocal</a>
                                    <a href="#" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">线程池</a>
                                    <a href="#" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">并发工具类</a>
                                </div>
                            </div>
                        </div>
                        <a href="#" class="px-3 py-2 rounded-md text-sm font-medium text-gray-700 hover:text-indigo-600 hover:bg-gray-100">开源项目</a>
                        <a href="#" class="px-3 py-2 rounded-md text-sm font-medium text-gray-700 hover:text-indigo-600 hover:bg-gray-100">关于我们</a>
                    </div>
                </div>
                <div class="-mr-2 flex items-center sm:hidden">
                    <button type="button" class="inline-flex items-center justify-center p-2 rounded-md text-gray-400 hover:text-gray-500 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-indigo-500">
                        <span class="sr-only">打开主菜单</span>
                        <i class="fas fa-bars"></i>
                    </button>
                </div>
            </div>
        </div>
    </nav>

    <!-- Hero Section -->
    <section class="hero py-20">
        <div class="max-w-6xl mx-auto px-4 sm:px-6 lg:px-8">
            <div class="text-center">
                <h1 class="text-4xl md:text-5xl font-bold mb-4">TransmittableThreadLocal</h1>
                <p class="text-xl md:text-2xl font-light max-w-3xl mx-auto mb-8">阿里巴巴开源的多线程数据传递解决方案</p>
                <div class="flex justify-center space-x-4">
                    <a href="https://github.com/alibaba/transmittable-thread-local" class="bg-white text-indigo-600 hover:bg-gray-100 px-6 py-3 rounded-lg font-medium inline-flex items-center">
                        <i class="fab fa-github mr-2"></i> GitHub仓库
                    </a>
                    <a href="#introduction" class="bg-indigo-700 text-white hover:bg-indigo-800 px-6 py-3 rounded-lg font-medium">
                        了解更多
                    </a>
                </div>
            </div>
        </div>
    </section>

    <!-- Main Content -->
    <main class="max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-12">
        <!-- Introduction -->
        <section id="introduction" class="mb-16">
            <div class="flex items-center mb-8">
                <div class="h-px bg-gray-300 flex-1"></div>
                <h2 class="text-3xl font-bold px-4 text-center">项目概述</h2>
                <div class="h-px bg-gray-300 flex-1"></div>
            </div>
            
            <div class="bg-white rounded-xl shadow-md overflow-hidden card">
                <div class="p-8">
                    <p class="text-lg mb-6 leading-relaxed">
                        <span class="text-indigo-600 font-bold">TransmittableThreadLocal</span> 是阿里巴巴的开源项目 <a href="https://github.com/alibaba/transmittable-thread-local" class="text-indigo-600 hover:underline">Java Common Utilities</a> 中的一个工具类，它是对 Java 标准库中的 <code class="bg-gray-100 px-2 py-1 rounded">ThreadLocal</code> 的扩展，专门用于解决多线程编程中的数据传递问题，尤其是在使用线程池等异步执行框架时的数据传递问题。
                    </p>
                    <p class="text-lg mb-6 leading-relaxed">
                        它通过在任务提交时进行数据快照，并在任务执行时恢复这些快照数据，确保 <code class="bg-gray-100 px-2 py-1 rounded">ThreadLocal</code> 数据能够在异步执行环境中正确传递并隔离。这使得它在复杂的多线程环境中成为一种非常实用的工具，尤其是在需要传递上下文信息的场景中。
                    </p>
                    <div class="flex justify-center mt-8">
                        <div class="p-4 rounded-lg bg-indigo-50 border border-indigo-100 max-w-2xl">
                            <div class="flex items-start">
                                <div class="flex-shrink-0 pt-1">
                                    <i class="fas fa-info-circle text-indigo-600 text-xl"></i>
                                </div>
                                <div class="ml-3">
                                    <h3 class="text-lg font-medium text-indigo-800">核心价值</h3>
                                    <p class="mt-1 text-gray-700">解决线程池复用导致的数据混乱问题，实现异步任务间的上下文数据传递</p>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <!-- Limitations -->
        <section id="limitations" class="mb-16">
            <div class="flex items-center mb-8">
                <div class="h-px bg-gray-300 flex-1"></div>
                <h2 class="text-3xl font-bold px-4 text-center">ThreadLocal 的局限性</h2>
                <div class="h-px bg-gray-300 flex-1"></div>
            </div>
            
            <div class="grid md:grid-cols-2 gap-8">
                <div class="bg-white rounded-xl shadow-md overflow-hidden card">
                    <div class="p-8">
                        <div class="flex items-center mb-4">
                            <div class="bg-red-100 p-2 rounded-full mr-4">
                                <i class="fas fa-exclamation-triangle text-red-600"></i>
                            </div>
                            <h3 class="text-xl font-bold text-gray-800">线程复用问题</h3>
                        </div>
                        <p class="text-gray-700">
                            在线程池中，线程是被重复使用的。如果我们在线程 A 中设置了一个 <code class="bg-gray-100 px-1 py-0.5 rounded">ThreadLocal</code> 变量，而这个线程在任务完成后被归还到线程池中，当它再次被分配给线程 B 执行时，B 会继承 A 的 <code class="bg-gray-100 px-1 py-0.5 rounded">ThreadLocal</code> 变量值。这种行为在大多数情况下是不可预期的，可能导致数据混乱。
                        </p>
                    </div>
                </div>
                
                <div class="bg-white rounded-xl shadow-md overflow-hidden card">
                    <div class="p-8">
                        <div class="flex items-center mb-4">
                            <div class="bg-red-100 p-2 rounded-full mr-4">
                                <i class="fas fa-exclamation-triangle text-red-600"></i>
                            </div>
                            <h3 class="text-xl font-bold text-gray-800">异步执行问题</h3>
                        </div>
                        <p class="text-gray-700">
                            在异步任务（如通过 <code class="bg-gray-100 px-1 py-0.5 rounded">CompletableFuture</code>、<code class="bg-gray-100 px-1 py-0.5 rounded">ForkJoinPool</code>）中，由于任务的执行线程并不是固定的，标准的 <code class="bg-gray-100 px-1 py-0.5 rounded">ThreadLocal</code> 无法在异步线程间传递数据。
                        </p>
                    </div>
                </div>
            </div>
        </section>

        <!-- Advantages -->
        <section id="advantages" class="mb-16">
            <div class="flex items-center mb-8">
                <div class="h-px bg-gray-300 flex-1"></div>
                <h2 class="text-3xl font-bold px-4 text-center">TransmittableThreadLocal 的优势</h2>
                <div class="h-px bg-gray-300 flex-1"></div>
            </div>
            
            <div class="grid md:grid-cols-2 gap-8 mb-12">
                <div class="bg-white rounded-xl shadow-md overflow-hidden card">
                    <div class="p-8">
                        <div class="flex items-center mb-4">
                            <div class="bg-green-100 p-2 rounded-full mr-4">
                                <i class="fas fa-check-circle text-green-600"></i>
                            </div>
                            <h3 class="text-xl font-bold text-gray-800">线程池场景</h3>
                        </div>
                        <p class="text-gray-700">
                            <code class="bg-gray-100 px-1 py-0.5 rounded">TransmittableThreadLocal</code> 可以在任务提交到线程池时，将父线程中的 <code class="bg-gray-100 px-1 py-0.5 rounded">ThreadLocal</code> 数据"传递"到执行任务的线程中。这意味着，线程 B 即使继承了线程 A 的 <code class="bg-gray-100 px-1 py-0.5 rounded">ThreadLocal</code> 数据，也是在安全的范围内，因为在任务执行之前已经进行了一次"数据传递"操作。
                        </p>
                    </div>
                </div>
                
                <div class="bg-white rounded-xl shadow-md overflow-hidden card">
                    <div class="p-8">
                        <div class="flex items-center mb-4">
                            <div class="bg-green-100 p-2 rounded-full mr-4">
                                <i class="fas fa-check-circle text-green-600"></i>
                            </div>
                            <h3 class="text-xl font-bold text-gray-800">异步场景</h3>
                        </div>
                        <p class="text-gray-700">
                            <code class="bg-gray-100 px-1 py-0.5 rounded">TransmittableThreadLocal</code> 也支持在异步任务中传递 <code class="bg-gray-100 px-1 py-0.5 rounded">ThreadLocal</code> 数据，即使任务在不同的线程中执行，父线程的数据也能正确传递到子线程中，并在子线程执行结束后自动清理，避免了数据泄露问题。
                        </p>
                    </div>
                </div>
            </div>
            
            <!-- Visualization -->
            <div class="bg-white rounded-xl shadow-md overflow-hidden mb-8">
                <div class="p-8">
                    <h3 class="text-2xl font-bold mb-6 text-center">TransmittableThreadLocal 工作原理</h3>
                    <div class="mermaid">
                        graph TD
                            A[主线程设置TTL值] --> B[提交任务到线程池]
                            B --> C[TTL捕获当前线程的上下文]
                            C --> D[线程池线程执行任务]
                            D --> E[TTL恢复快照的上下文]
                            E --> F[任务执行]
                            F --> G[TTL清理恢复的上下文]
                            G --> H[线程回到线程池]
                    </div>
                </div>
            </div>
        </section>

        <!-- Implementation -->
        <section id="implementation" class="mb-16">
            <div class="flex items-center mb-8">
                <div class="h-px bg-gray-300 flex-1"></div>
                <h2 class="text-3xl font-bold px-4 text-center">实现原理</h2>
                <div class="h-px bg-gray-300 flex-1"></div>
            </div>
            
            <div class="bg-white rounded-xl shadow-md overflow-hidden card">
                <div class="p-8">
                    <p class="text-lg mb-6 leading-relaxed">
                        <code class="bg-gray-100 px-2 py-1 rounded">TransmittableThreadLocal</code> 通过 <code class="bg-gray-100 px-2 py-1 rounded">Runnable</code> 和 <code class="bg-gray-100 px-2 py-1 rounded">Callable</code> 的包装器实现数据传递。它会在任务提交前将当前线程中的 <code class="bg-gray-100 px-2 py-1 rounded">ThreadLocal</code> 数据进行快照，然后在任务执行时将这些快照数据传递给执行线程。执行结束后，再恢复线程池中原有的 <code class="bg-gray-100 px-2 py-1 rounded">ThreadLocal</code> 数据，确保线程池中的线程不会被污染。
                    </p>
                    <p class="text-lg mb-6 leading-relaxed">
                        这个设计保证了 <code class="bg-gray-100 px-2 py-1 rounded">ThreadLocal</code> 数据的正确传递，同时也解决了线程池复用导致的数据混乱问题。
                    </p>
                    
                    <div class="highlight p-6 rounded-lg my-6">
                        <h4 class="font-bold text-lg mb-3 text-indigo-800">核心代码示例</h4>
                        <pre class="bg-gray-800 text-gray-100 p-4 rounded overflow-x-auto">
<code>TransmittableThreadLocal&lt;String&gt; context = new TransmittableThreadLocal&lt;&gt;();
context.set("main-thread-value");

ExecutorService executor = TtlExecutors.getTtlExecutorService(
    Executors.newFixedThreadPool(1)
);

executor.submit(() -> {
    // 子线程中可以获取到父线程设置的context值
    System.out.println(context.get()); // 输出: main-thread-value
});</code></pre>
                    </div>
                </div>
            </div>
        </section>

        <!-- Use Cases -->
        <section id="use-cases" class="mb-16">
            <div class="flex items-center mb-8">
                <div class="h-px bg-gray-300 flex-1"></div>
                <h2 class="text-3xl font-bold px-4 text-center">使用场景</h2>
                <div class="h-px bg-gray-300 flex-1"></div>
            </div>
            
            <div class="grid md:grid-cols-2 gap-8">
                <div class="bg-white rounded-xl shadow-md overflow-hidden card">
                    <div class="p-8">
                        <div class="flex items-center mb-4">
                            <div class="bg-indigo-100 p-2 rounded-full mr-4">
                                <i class="fas fa-project-diagram text-indigo-600"></i>
                            </div>
                            <h3 class="text-xl font-bold text-gray-800">分布式追踪</h3>
                        </div>
                        <p class="text-gray-700">
                            在分布式系统中，<code class="bg-gray-100 px-1 py-0.5 rounded">TransmittableThreadLocal</code> 可以用于传递分布式追踪 ID，确保在异步调用链路中正确传递追踪信息，实现完整的调用链监控。
                        </p>
                    </div>
                </div>
                
                <div class="bg-white rounded-xl shadow-md overflow-hidden card">
                    <div class="p-8">
                        <div class="flex items-center mb-4">
                            <div class="bg-indigo-100 p-2 rounded-full mr-4">
                                <i class="fas fa-users text-indigo-600"></i>
                            </div>
                            <h3 class="text-xl font-bold text-gray-800">上下文信息传递</h3>
                        </div>
                        <p class="text-gray-700">
                            比如用户信息、租户信息等上下文数据在异步任务执行中需要传递的场景，可以确保这些信息在异步线程中也能正确获取。
                        </p>
                    </div>
                </div>
            </div>
            
            <div class="mt-8 bg-white rounded-xl shadow-md overflow-hidden card">
                <div class="p-8">
                    <h3 class="text-xl font-bold mb-4 text-gray-800">典型应用场景关系图</h3>
                    <div class="mermaid">
                        graph LR
                            A[Web请求入口] --> B[设置用户信息到TTL]
                            B --> C[提交异步任务]
                            C --> D1[异步任务1读取TTL]
                            C --> D2[异步任务2读取TTL]
                            C --> D3[异步任务3读取TTL]
                            D1 --> E[日志记录用户信息]
                            D2 --> F[数据库操作]
                            D3 --> G[远程调用]
                    </div>
                </div>
            </div>
        </section>

        <!-- Comparison Table -->
        <section id="comparison" class="mb-16">
            <div class="flex items-center mb-8">
                <div class="h-px bg-gray-300 flex-1"></div>
                <h2 class="text-3xl font-bold px-4 text-center">功能对比</h2>
                <div class="h-px bg-gray-300 flex-1"></div>
            </div>
            
            <div class="bg-white rounded-xl shadow-md overflow-hidden">
                <div class="overflow-x-auto">
                    <table class="min-w-full divide-y divide-gray-200">
                        <thead class="bg-gray-50">
                            <tr>
                                <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">特性</th>
                                <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">ThreadLocal</th>
                                <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">InheritableThreadLocal</th>
                                <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">TransmittableThreadLocal</th>
                            </tr>
                        </thead>
                        <tbody class="bg-white divide-y divide-gray-200">
                            <tr>
                                <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">线程隔离</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">是</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">是</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">是</td>
                            </tr>
                            <tr>
                                <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">子线程继承</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">否</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">是</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">是</td>
                            </tr>
                            <tr>
                                <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">线程池支持</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">否</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">部分</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">是</td>
                            </tr>
                            <tr>
                                <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">异步任务支持</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">否</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">否</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">是</td>
                            </tr>
                            <tr>
                                <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">自动清理</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">否</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">否</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">是</td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </section>

        <!-- Conclusion -->
        <section id="conclusion" class="mb-16">
            <div class="bg-indigo-50 rounded-xl p-8">
                <div class="flex items-start">
                    <div class="flex-shrink-0">
                        <i class="fas fa-lightbulb text-indigo-600 text-2xl"></i>
                    </div>
                    <div class="ml-4">
                        <h3 class="text-xl font-bold text-indigo-800 mb-2">何时选择 TransmittableThreadLocal？</h3>
                        <p class="text-gray-700">
                            如果你的应用涉及线程池或异步任务执行，并且需要在不同线程间传递上下文数据（如用户信息、追踪ID等），那么 <code class="bg-indigo-100 px-1 py-0.5 rounded">TransmittableThreadLocal</code> 是一个理想的选择。它解决了传统 <code class="bg-indigo-100 px-1 py-0.5 rounded">ThreadLocal</code> 在线程池环境中的数据污染问题，提供了更安全、更可靠的数据传递机制。
                        </p>
                    </div>
                </div>
            </div>
        </section>
    </main>

    <!-- Footer -->
    <footer class="footer text-white py-8">
        <div class="max-w-6xl mx-auto px-4 sm:px-6 lg:px-8">
            <div class="flex flex-col md:flex-row justify-between items-center">
                <div class="flex items-center mb-4 md:mb-0">
                    <i class="fas fa-laptop-code text-gray-400 mr-2"></i>
                    <span class="text-lg font-medium">技术小馆</span>
                </div>
                <div>
                    <a href="http://www.yuque.com/jtostring" class="text-gray-400 hover:text-white transition duration-150 ease-in-out">
                        <i class="fas fa-external-link-alt mr-1"></i> http://www.yuque.com/jtostring
                    </a>
                </div>
            </div>
        </div>
    </footer>

    <script>
        // Initialize Mermaid
        mermaid.initialize({
            startOnLoad: true,
            theme: 'default',
            flowchart: {
                useMaxWidth: true,
                htmlLabels: true,
                curve: 'basis'
            }
        });
    </script>
</body>
</html>
```